// Proxy
const Person = {
    name: "张三",
    age: 18
}

const proxy = new Proxy(Person, {
    get(target, property) {
        return property in target ? target[property] : "default"
    },
    set(target, property, val) {
        if (!Number.isInteger(val)) {
            throw new TypeError(`${val} is not an int`)
        }
        target[property] = val
    }
})
proxy.age = 100
proxy.gender = true

console.log(proxy.name)
console.log(proxy.xxxxx)